const seq = require('../../../../db/seq');
const { string, integer } = require('../../../../db/types');
const { verification } = require('../../../../db/verification')

const model = {
    label: {
        allowNull: false,
        comment: '角色名称',
        type: string,
        verification: 'string',
    },
    describe: {
        allowNull: false,
        comment: '角色描述',
        type: string,
        verification: 'string',
    },
    status: {
        allowNull: false,
        comment: '角色状态',
        type: integer,
        verification: 'number',
    }
}

const verifiRole = (data) => {
    return verification(data, model);
}

// 系统角色表
const Roles = seq.define('roles', model);

module.exports = {
    Roles,
    verifiRole
};
